import 'package:flutter/services.dart';

class Toast {
  // 获取原生Toast
  static const TOAST = const MethodChannel("com.mazaiting/toast");

  /// 显示 Toast
  /// @param msg 显示信息
  static Future<void> show(msg) async {
    try {
      final String result = await TOAST.invokeMethod('showToast', {'msg': msg});
      print("Android_Toast: " + result);
    } on PlatformException catch (e) {
      print("Android_Toast: " + e.message);
    }
  }
}
